package dper.study.codes.hbase.util;

import org.apache.hadoop.hbase.util.MD5Hash;

import java.util.Date;

/**
 * Created by leichen on 2017/4/14.
 */
public class RowKeyUtil {
    public static String buildGRRowKey(int authorId ,Date update_time){
        String rowKey = MD5Hash.getMD5AsHex((authorId+"").getBytes())+
                "_" + (Long.MAX_VALUE - update_time.getTime());
        return rowKey;
    }

    public static String buildGRRowKey(int authorId ,String suffix){
        String rowKey = MD5Hash.getMD5AsHex((authorId+"").getBytes())+
                "_" + suffix;
        return rowKey;
    }

    public static String buildGRRowKey(int authorId ){
        String rowKey = MD5Hash.getMD5AsHex((authorId+"").getBytes()) ;
        return rowKey;
    }
}
